{include file="public/header"/}

<style>
    .notdata {
        padding: 15px;
        display: block;
        font-size: 13px;
        text-align: center;
        line-height: 22px;
        letter-spacing: 8px;
        border: 1px solid #e6e6e6;
        background-color: #f2f2f2;
        border-radius: 0 2px 2px 0;
    }

    .notselect {
        user-select: none;
        -ms-user-select: none;
        -moz-user-select: none;
        -webkit-user-select: none;
    }

    .transition {
        transition: all 0.2s linear;
        -o-transition: all 0.2s linear;
        -moz-transition: all 0.2s linear;
        -webkit-transition: all 0.2s linear;
    }

    .absolute {
        position: absolute !important;
    }

    .relative {
        position: relative !important;
    }

    .block {
        display: block !important;
    }

    .pointer {
        cursor: pointer !important;
    }

    .nowrap {
        white-space: nowrap !important;
    }

    .help-block {
        color: #999;
        font-size: 12px;
    }

    .inline-block {
        display: inline-block !important;
    }

    .pull-left {
        float: left !important;
    }

    .pull-right {
        float: right !important;
    }

    .full-width {
        width: 100% !important;
    }

    .full-height {
        height: 100% !important;
    }

    .color-red {
        color: #ec494e !important;
    }

    .color-blue {
        color: #2494f2 !important;
    }

    .color-desc {
        color: #999 !important;
    }

    .color-text {
        color: #333 !important;
    }

    .color-green {
        color: #090 !important;
    }

    .sub-span-red span {
        color: #ec494e !important;
    }

    .sub-span-blue span {
        color: #2494f2 !important;
    }

    .sub-span-desc span {
        color: #999 !important;
    }

    .sub-span-text span {
        color: #333 !important;
    }

    .sub-span-green span {
        color: #090 !important;
    }

    .text-top {
        vertical-align: top !important;
    }

    .text-left {
        text-align: left !important;
    }

    .text-right {
        text-align: right !important;
    }

    .text-center {
        text-align: center !important;
    }

    .text-middle {
        vertical-align: middle !important;
    }

    .text-bottom {
        vertical-align: bottom !important;
    }

    .think-bg-white {
        background: white !important;
    }

    .think-bg-blue {
        background: linear-gradient(-125deg, #57bdbf, #2f9de2) !important;
    }

    .think-bg-orig {
        background: linear-gradient(-141deg, #ecca1b, #f39526) !important;
    }

    .think-bg-red {
        background: linear-gradient(-125deg, #ff7d7d, #fb2c95) !important;
    }

    .think-bg-violet {
        background: linear-gradient(-113deg, #c543d8, #925cc3) !important;
    }

    /* 分隔线条 */
    .hr-line-dashed {
        color: #fff;
        height: 1px;
        margin: 15px 0;
        background-color: #fff;
        border-top: 1px dashed #e7eaec;
    }

    .hr-line-solid {
        margin-top: 15px;
        margin-bottom: 15px;
        border-bottom: 1px solid #e7eaec;
        background-color: rgba(0, 0, 0, 0);
    }

    /* 文字大小 */
    .border-0 {
        border: 0 !important;
    }

    .border-radius {
        border-radius: 50% !important;
    }

    .border-radius-0 {
        border-radius: 0 !important;
    }

    .border-radius-left-0 {
        border-top-left-radius: 0 !important;
        border-bottom-left-radius: 0 !important;
    }

    .border-radius-right-0 {
        border-top-right-radius: 0 !important;
        border-bottom-right-radius: 0 !important;
    }

    .font-s10 {
        font-size: 10px !important;
    }

    .font-s11 {
        font-size: 11px !important;
    }

    .font-s12 {
        font-size: 12px !important;
    }

    .font-s13 {
        font-size: 13px !important;
    }

    .font-s14 {
        font-size: 14px !important;
    }

    .font-s15 {
        font-size: 15px !important;
    }

    .font-s16 {
        font-size: 16px !important;
    }

    .font-s18 {
        font-size: 18px !important;
    }

    .font-s20 {
        font-size: 20px !important;
    }

    .font-s30 {
        font-size: 30px !important;
    }

    .font-s40 {
        font-size: 40px !important;
    }

    .font-w1 {
        font-weight: 100 !important;
    }

    .font-w2 {
        font-weight: 200 !important;
    }

    .font-w3 {
        font-weight: 300 !important;
    }

    .font-w4 {
        font-weight: 400 !important;
    }

    .font-w5 {
        font-weight: 500 !important;
    }

    .font-w6 {
        font-weight: 600 !important;
    }

    .font-w7 {
        font-weight: 700 !important;
    }

    .font-w8 {
        font-weight: 800 !important;
    }

    .font-w9 {
        font-weight: 900 !important;
    }

    .padding-0 {
        padding: 0 !important;
    }

    .padding-5 {
        padding: 5px !important;
    }

    .padding-10 {
        padding: 10px !important;
    }

    .padding-15 {
        padding: 15px !important;
    }

    .padding-20 {
        padding: 20px !important;
    }

    .padding-25 {
        padding: 25px !important;
    }

    .padding-30 {
        padding: 30px !important;
    }

    .padding-40 {
        padding: 40px !important;
    }

    .padding-top-0 {
        padding-top: 0 !important;
    }

    .padding-top-5 {
        padding-top: 5px !important;
    }

    .padding-top-10 {
        padding-top: 10px !important;
    }

    .padding-top-15 {
        padding-top: 15px !important;
    }

    .padding-top-20 {
        padding-top: 20px !important;
    }

    .padding-top-30 {
        padding-top: 30px !important;
    }

    .padding-top-40 {
        padding-top: 40px !important;
    }

    .padding-left-0 {
        padding-left: 0 !important;
    }

    .padding-left-5 {
        padding-left: 5px !important;
    }

    .padding-left-10 {
        padding-left: 10px !important;
    }

    .padding-left-15 {
        padding-left: 15px !important;
    }

    .padding-left-20 {
        padding-left: 20px !important;
    }

    .padding-left-30 {
        padding-left: 30px !important;
    }

    .padding-left-40 {
        padding-left: 40px !important;
    }

    .padding-right-0 {
        padding-right: 0 !important;
    }

    .padding-right-5 {
        padding-right: 5px !important;
    }

    .padding-right-10 {
        padding-right: 10px !important;
    }

    .padding-right-15 {
        padding-right: 15px !important;
    }

    .padding-right-20 {
        padding-right: 20px !important;
    }

    .padding-right-30 {
        padding-right: 30px !important;
    }

    .padding-right-40 {
        padding-right: 40px !important;
    }

    .padding-bottom-0 {
        padding-bottom: 0 !important;
    }

    .padding-bottom-5 {
        padding-bottom: 5px !important;
    }

    .padding-bottom-10 {
        padding-bottom: 10px !important;
    }

    .padding-bottom-15 {
        padding-bottom: 15px !important;
    }

    .padding-bottom-20 {
        padding-bottom: 20px !important;
    }

    .padding-bottom-30 {
        padding-bottom: 30px !important;
    }

    .padding-bottom-40 {
        padding-bottom: 40px !important;
    }

    .margin-0 {
        margin: 0 !important;
    }

    .margin-5 {
        margin: 5px !important;
    }

    .margin-10 {
        margin: 10px !important;
    }

    .margin-15 {
        margin: 15px !important;
    }

    .margin-20 {
        margin: 20px !important;
    }

    .margin-25 {
        margin: 25px !important;
    }

    .margin-30 {
        margin: 30px !important;
    }

    .margin-40 {
        margin: 40px !important;
    }

    .margin-top-0 {
        margin-top: 0 !important;
    }

    .margin-top-5 {
        margin-top: 5px !important;
    }

    .margin-top-10 {
        margin-top: 10px !important;
    }

    .margin-top-15 {
        margin-top: 15px !important;
    }

    .margin-top-20 {
        margin-top: 20px !important;
    }

    .margin-top-25 {
        margin-top: 25px !important;
    }

    .margin-top-30 {
        margin-top: 30px !important;
    }

    .margin-top-40 {
        margin-top: 40px !important;
    }

    .margin-left-0 {
        margin-left: 0 !important;
    }

    .margin-left-5 {
        margin-left: 5px !important;
    }

    .margin-left-10 {
        margin-left: 10px !important;
    }

    .margin-left-15 {
        margin-left: 15px !important;
    }

    .margin-left-20 {
        margin-left: 20px !important;
    }

    .margin-left-25 {
        margin-left: 25px !important;
    }

    .margin-left-30 {
        margin-left: 30px !important;
    }

    .margin-left-40 {
        margin-left: 40px !important;
    }

    .margin-right-0 {
        margin-right: 0 !important;
    }

    .margin-right-5 {
        margin-right: 5px !important;
    }

    .margin-right-10 {
        margin-right: 10px !important;
    }

    .margin-right-15 {
        margin-right: 15px !important;
    }

    .margin-right-20 {
        margin-right: 20px !important;
    }

    .margin-right-25 {
        margin-right: 25px !important;
    }

    .margin-right-30 {
        margin-right: 30px !important;
    }

    .margin-right-40 {
        margin-right: 40px !important;
    }

    .margin-bottom-0 {
        margin-bottom: 0 !important;
    }

    .margin-bottom-5 {
        margin-bottom: 5px !important;
    }

    .margin-bottom-10 {
        margin-bottom: 10px !important;
    }

    .margin-bottom-15 {
        margin-bottom: 15px !important;
    }

    .margin-bottom-20 {
        margin-bottom: 20px !important;
    }

    .margin-bottom-25 {
        margin-bottom: 25px !important;
    }

    .margin-bottom-30 {
        margin-bottom: 30px !important;
    }

    .margin-bottom-40 {
        margin-bottom: 40px !important;
    }

    /*# sourceMappingURL=console.custom.css.map */

    /* 页面布局 - 全局 */
    .layui-layout > .layui-side {
        top: 50px;
        bottom: 0;
        overflow: auto;
    }

    .layui-layout > .layui-body {
        top: 50px;
        bottom: 0;
        overflow: auto;
    }

    .layui-layout > .layui-body > .layui-card {
        box-shadow: none;
    }

    .layui-layout > .layui-body > .layui-card > .layui-card-body {
        padding: 15px 15px;
    }

    .layui-layout > .layui-body > .layui-card > .layui-card-header {
        height: 50px;
        border: none;
        line-height: 50px;
        box-shadow: 0 2px 3px 0 rgba(0, 0, 0, 0.1);
        background: #fff;
    }

    /* 页面布局 - 头部 */
    .layui-header {
        height: 50px;
        background: #393D49 !important;
    }

    .layui-header [data-target-menu-type] {
        border-left: 1px solid rgba(0, 0, 0, 0);
        border-right: 1px solid rgba(0, 0, 0, 0.15);
    }

    .layui-header .layui-layout-left,
    .layui-header .layui-layout-right {
        padding: 0;
    }

    .layui-header .layui-logo {
        color: #fff;
        width: 199px;
        height: auto;
        font-size: 18px;
        line-height: 49px;
        border-right: 1px solid rgba(0, 0, 0, 0.15);
        border-bottom: 1px solid rgba(0, 0, 0, 0.15);
    }

    .layui-header .layui-logo sup {
        font-size: 9px;
        line-height: 9px;
    }

    .layui-header .layui-nav-item {
        height: 50px;
        line-height: 50px;
    }

    .layui-header .layui-nav-item.layui-this {
        background: #009688;
    }

    .layui-header .layui-nav-item > a {
        color: #fff !important;
    }

    .layui-header .layui-nav-item .layui-nav-child {
        top: 49px;
        padding: 0;
        border: none;
        line-height: 45px;
    }

    .layui-header .layui-nav-item .layui-nav-child + a {
        padding-right: 35px;
    }

    .layui-header .layui-nav-item .layui-nav-child.layui-show + a {
        background: #fff;
    }

    .layui-header .layui-nav-item .layui-nav-child.layui-show + a span {
        color: #333;
    }

    .layui-header .layui-nav-item .layui-nav-child dd a {
        padding: 0;
        color: #333;
        text-align: center;
        border-top: 1px solid #eaedf1;
    }

    .layui-header .layui-nav-bar,
    .layui-header .layui-nav-item:after {
        display: none !important;
    }

    .layui-header .layui-layout-right > li > a {
        border-left: 1px solid rgba(0, 0, 0, 0.15);
        border-right: 1px solid rgba(0, 0, 0, 0);
    }

    /* 页面布局 - 左则 */
    .layui-layout > .layui-side .layui-nav-bar {
        display: none !important;
    }

    .layui-layout > .layui-side .layui-side-scroll {
        width: 100% !important;
    }

    .layui-layout > .layui-side .layui-nav-item {
        border-bottom: 1px solid rgba(0, 0, 0, 0.2);
    }

    .layui-layout > .layui-side .layui-nav-item a {
        height: 45px;
        display: block;
        line-height: 45px;
        color: #fff !important;
    }

    .layui-layout > .layui-side .layui-nav-item a:hover {
        background: hsla(0, 0%, 39%, 0.2) !important;
    }

    .layui-layout > .layui-side .layui-nav-itemed {
        border-bottom: none !important;
    }

    .layui-layout > .layui-side .layui-nav-tree-top a {
        height: 28px !important;
        line-height: 28px !important;
    }

    .layui-layout.layui-layout-left-mini > .layui-body {
        left: 50px;
    }

    .layui-layout.layui-layout-left-mini > .layui-side .layui-nav-more {
        display: none !important;
    }

    .layui-layout.layui-layout-left-mini > .layui-side .layui-nav-item a {
        padding: 0;
    }

    .layui-layout.layui-layout-left-mini > .layui-side .layui-nav-item .nav-text {
        display: none;
    }

    .layui-layout.layui-layout-left-mini > .layui-side .layui-nav-item .nav-icon {
        display: inline-block !important;
        padding: 0 !important;
    }

    .layui-layout.layui-layout-left-mini > .layui-side .layui-nav-item .layui-nav-child {
        padding: 0;
        display: block !important;
        background-color: rgba(0, 0, 0, 0.3) !important;
    }

    .layui-layout.layui-layout-left-mini > .layui-side,
    .layui-layout.layui-layout-left-mini > .layui-side .layui-nav-tree,
    .layui-layout.layui-layout-left-mini > .layui-side .layui-side-scroll {
        width: 50px;
        text-align: center;
    }

    .layui-layout.layui-layout-left-mini [data-target-menu-type] i {
        display: inline-block;
        -webkit-transform: rotate(180deg);
        transform: rotate(180deg);
        -ms-transform: rotate(180deg);
    }

    .layui-layout.layui-layout-left-hide > .layui-body {
        left: 0 !important;
    }

    .layui-layout.layui-layout-left-hide > .layui-side {
        display: none;
    }

    .layui-layout.layui-layout-left-hide [data-target-menu-type] {
        display: none;
    }

    .think-switch-button .layui-form-switch {
        margin-top: 0;
    }

    .input-right-icon {
        top: 0;
        right: 0;
        width: 38px;
        height: 38px;
        display: inline-block;
        position: absolute;
        text-align: center;
        line-height: 38px;
    }

    /** 加载进度 */
    .pace-inactive {
        display: none;
    }

    .pace-progress {
        top: 0;
        right: 100%;
        width: 100%;
        height: 2px;
        z-index: 2000;
        position: fixed;
        background: #22df80;
    }

    .uploadimage {
        width: 77px;
        height: 77px;
        cursor: pointer;
        position: relative;
        display: inline-block;
        border: 1px dashed #e2e2e2;
        background: url('../img/upimg.png') no-repeat center center;
        background-size: cover;
    }

    .uploadimage:hover span.layui-icon {
        display: inline-block;
    }

    .uploadimage span.layui-icon {
        display: none;
        width: 20px;
        height: 20px;
        text-align: center;
        line-height: 22px;
        color: #fff;
        right: 0;
        position: absolute;
        background: rgba(0, 0, 0, 0.5);
    }

    .uploadimagemtl {
        margin-right: 8px;
    }

    .uploadimagemtl a {
        color: #fff;
        width: 20px;
        height: 20px;
        float: right;
        display: none;
        text-align: center;
        line-height: 22px;
        background: rgba(0, 0, 0, 0.5);
    }

    .uploadimagemtl:hover a {
        cursor: pointer;
        display: inline-block;
    }

    .uploadimagemtl:hover a:hover {
        color: #fff;
        text-decoration: none;
    }

    [data-tips-image] {
        cursor: zoom-in !important;
    }

    .portal-block-container {
        font-size: 14px;
        letter-spacing: 1px;
    }

    .portal-block-container .portal-block-icon {
        top: 45%;
        right: 8%;
        font-size: 65px;
        position: absolute;
        color: rgba(255, 255, 255, 0.4);
    }

    .portal-block-container .portal-block-item {
        color: #fff;
        line-height: 4em;
        padding: 15px 25px;
        position: relative;
    }

    .portal-block-container .portal-block-item > div:nth-child(2) {
        font-size: 46px;
        line-height: 46px;
    }

    /* 通用分页 */
    .pagination-container {
        line-height: 40px;
    }

    .pagination-container > span {
        color: #666;
        font-size: 9pt;
    }

    .pagination-container > ul {
        float: right;
        display: inline-block;
        margin: 0;
        padding: 0;
    }

    .pagination-container > ul > li {
        z-index: 1;
        display: inline-block;
    }

    .pagination-container > ul > li.active {
        z-index: 2;
    }

    .pagination-container > ul > li.active > span {
        color: #fff;
        border-color: #098;
        padding-right: 1px;
        background: #009688 !important;
    }

    .pagination-container > ul > li > a,
    .pagination-container > ul > li > span {
        color: #333;
        width: 33px;
        height: 30px;
        border: 1px solid #dcdcdc;
        display: inline-block;
        margin-left: -1px;
        text-align: center;
        line-height: 28px;
    }

    .pagination-container > ul > li > span {
        background: #dcdcdc;
        cursor: default;
    }

    .pagination-container > ul > li > a:hover {
        background: #dcdcdc;
        border-color: #dcdcdc;
    }

    /** 手机盒子及微信菜单 */
    .mobile-preview {
        width: 317px;
        height: 580px;
        position: relative;
        background: url(../img/wechat/mobile_head.png) no-repeat 0 0;
    }

    .mobile-preview .mobile-header {
        color: #fff;
        width: auto;
        margin: 0 30px;
        overflow: hidden;
        font-size: 15px;
        padding-top: 30px;
        text-align: center;
        white-space: nowrap;
        text-overflow: ellipsis;
        word-wrap: normal;
        user-select: none;
        pointer-events: none;
        -moz-user-select: none;
        -webkit-user-select: none;
        -webkit-pointer-events: none;
    }

    .mobile-preview .mobile-body {
        top: 60px;
        left: 0;
        right: 0;
        bottom: 0;
        position: absolute;
        border: 1px solid #ccc;
        background: #f5f5f5;
    }

    .mobile-preview .mobile-body iframe {
        width: 100%;
        height: 100%;
    }

    .mobile-preview .mobile-footer {
        left: 0;
        right: 0;
        bottom: 0;
        margin: 0;
        position: absolute;
        padding-left: 43px;
        border: 1px solid #ccc;
        list-style-type: none;
        background: url(../img/wechat/mobile_foot.png) no-repeat 0 0;
    }

    .mobile-preview .mobile-footer li {
        float: left;
        width: 33.33%;
        position: relative;
        text-align: center;
        line-height: 50px;
    }

    .mobile-preview .mobile-footer li a {
        width: auto;
        display: block;
        overflow: hidden;
        border: 1px solid hsla(0, 0%, 100%, 0);
        border-left: 1px solid #e7e7eb;
        margin-top: -1px;
        margin-bottom: -1px;
        color: #616161;
        white-space: nowrap;
        text-decoration: none;
        text-overflow: ellipsis;
        word-wrap: normal;
    }

    .mobile-preview .mobile-footer li a:hover {
        background: rgba(0, 0, 0, 0.02);
    }

    .mobile-preview .mobile-footer li a.active {
        border: 1px solid #44b549 !important;
        box-shadow: 0 0 1px #44b549;
    }

    .mobile-preview .mobile-footer li a span:before {
        width: 1px;
        height: 1px;
        content: '';
        display: inline-block;
    }

    .mobile-preview .mobile-footer li > .close {
        top: 1px;
        right: 1px;
        width: 18px;
        height: 18px;
        display: none;
        cursor: pointer;
        position: absolute;
        text-align: center;
        line-height: 18px;
    }

    .mobile-preview .mobile-footer li:hover > .close {
        display: inline-block;
    }

    .mobile-preview .mobile-footer li:hover > .close:hover {
        color: #fff !important;
        background: #999 !important;
    }

    .mobile-preview .mobile-footer .icon-add {
        width: 14px;
        height: 14px;
        border-bottom: none !important;
        background: url(../img/wechat/index.png) 0 0 no-repeat;
    }

    .mobile-preview .mobile-footer .icon-add,
    .mobile-preview .mobile-footer .icon-sub {
        display: inline-block;
        vertical-align: middle;
    }

    .mobile-preview .mobile-footer .icon-sub {
        width: 7px;
        height: 7px;
        margin-right: 2px;
        background: url(../img/wechat/index.png) 0 -3pc no-repeat;
    }

    .mobile-preview .mobile-footer .sub-menu {
        width: 100%;
        bottom: 60px;
        margin: -1px;
        display: block;
        position: absolute;
        border: 1px solid #d0d0d0;
        background-color: #fafafa;
    }

    .mobile-preview .mobile-footer .sub-menu ul,
    .mobile-preview .mobile-footer .sub-menu ul li {
        float: none;
        padding: 0;
        z-index: 11;
        display: block;
        width: 100%;
    }

    .mobile-preview .mobile-footer .sub-menu ul li a {
        padding: 0 5px;
        border: 1px solid hsla(0, 0%, 100%, 0);
    }

    .mobile-preview .mobile-footer .sub-menu ul li a.bottom-border {
        margin: -1px -1px 0;
        border-bottom: 1px solid #e7e7eb;
    }

    .mobile-preview .mobile-footer .sub-menu ul li:last-child a.bottom-border {
        border-bottom-color: #fff;
    }

    .mobile-preview .mobile-footer .arrow {
        left: 50%;
        position: absolute;
        margin-left: -6px;
    }

    .mobile-preview .mobile-footer .arrow_in,
    .mobile-preview .mobile-footer .arrow_out {
        width: 0;
        height: 0;
        z-index: 10;
        display: inline-block;
        border: 6px dashed transparent;
        border-bottom-width: 0;
        border-top-style: solid;
    }

    .mobile-preview .mobile-footer .arrow_in {
        z-index: 3;
        bottom: -5px;
        border-top-color: #fafafa;
    }

    .mobile-preview .mobile-footer .arrow_out {
        z-index: 2;
        bottom: -6px;
        border-top-color: #d0d0d0;
    }

    /*# sourceMappingURL=console.layout.css.map */
</style>

<body class="gray-bg" style="padding: 20px;background: #fff">


<fieldset class="margin-bottom-15">
    <legend class="notselect">守护状态</legend>
    <div class="layui-code border-0 margin-top-0">
        <h4 class="color-desc margin-top-10 notselect">守护进程运行状态</h4>
        {if $listen}
        <span class="color-green">{$message|default='--'}</span>
        {else}
        <span class="color-red">{$message|default='--'}</span>
        {/if}
        <h4 class="color-desc margin-top-10 notselect">配置定时任务来检查并启动进程（建议每分钟执行）</h4>
        <p>{$command|default='--'}</p>
    </div>
</fieldset>


<div class="think-box-shadow">
    <div class="layui-row layui-col-space20 portal-block-container notselect">
        <div class="layui-col-sm6 layui-col-md3">
            <div class="portal-block-item nowrap" style="background:linear-gradient(-125deg,#57bdbf,#2f9de2)">
                <div>待处理</div>
                <div>{$total.pre|default=0}</div>
                <div>待处理的任务数量</div>
            </div>
            <i class="portal-block-icon layui-icon layui-icon-star"></i>
        </div>
        <div class="layui-col-sm6 layui-col-md3">
            <div class="portal-block-item nowrap" style="background:linear-gradient(-125deg,#ff7d7d,#fb2c95)">
                <div>处理中</div>
                <div>{$total.dos|default=0}</div>
                <div>处理中的任务数量</div>
            </div>
            <i class="portal-block-icon layui-icon layui-icon-log"></i>
        </div>
        <div class="layui-col-sm6 layui-col-md3">
            <div class="portal-block-item nowrap" style="background:linear-gradient(-113deg,#c543d8,#925cc3)">
                <div>处理完成</div>
                <div>{$total.oks|default=0}</div>
                <div>处理完成的任务数量</div>
            </div>
            <i class="portal-block-icon layui-icon layui-icon-release"></i>
        </div>
        <div class="layui-col-sm6 layui-col-md3">
            <div class="portal-block-item nowrap" style="background:linear-gradient(-141deg,#ecca1b,#f39526)">
                <div>处理失败</div>
                <div>{$total.ers|default=0}</div>
                <div>处理失败的任务数量</div>
            </div>
            <i class="portal-block-icon layui-icon layui-icon-engine"></i>
        </div>
    </div>


    <table class="layui-table margin-top-15" lay-skin="line">
        {notempty name='list'}
        <thead>
        <tr>
            <th class='list-table-check-td think-checkbox'>
                <label><input data-auto-none data-check-target='.list-check-box' type='checkbox'></label>
            </th>
            <th class='text-left nowrap'>任务信息</th>
            <th class='text-left nowrap'>任务时间</th>
            <th class='text-left nowrap'>任务状态</th>
        </tr>
        </thead>
        {/notempty}
        <tbody>
        {foreach $list as $key=>$vo}
        <tr>
            <td class='list-table-check-td think-checkbox'>
                <label><input class="list-check-box" value='{$vo.id}' type='checkbox'></label>
            </td>
            <td class='text-left nowrap'>
                任务编号：{$vo.code|default=''}<br>
                任务名称：{$vo.title|default=''}<br>
                任务指令：{$vo.command|default=''}
            </td>
            <td class='text-left nowrap'>
                计划时间：{$vo.exec_time|format_datetime} {if isset($vo.exec_pid) and $vo.exec_pid>0}（ 进程 <b
                    class="color-blue">{$vo.exec_pid|default='-'}</b>
                ）{/if}<br>
                {if $vo.enter_time>0 and $vo.outer_time>0} 执行时间：{$vo.enter_time|format_datetime}（ 耗时 <b
                    class="color-blue">{:sprintf("%.4f",$vo.outer_time-$vo.enter_time)}</b>
                秒 ）{elseif $vo.status eq 2} 执行时间：{$vo.enter_time|format_datetime}（ 任务执行中 ）{else}执行时间：<span
                    class="color-desc">任务还没有执行，等待执行...</span>{/if}<br>
                创建时间：{$vo.create_at|format_datetime} {if isset($vo.loops_time) and $vo.loops_time > 0}（ 每 <b
                    class="color-blue">{$vo.loops_time|default='0'}</b>
                秒执行，共 <b class="color-blue">{$vo.attempts}</b> 次）{else}（ 共执行 <b class="color-blue">{$vo.attempts}</b> 次
                ） {/if}
            </td>
            <td class='text-left nowrap'>
                <div class="margin-bottom-5">
                    {if isset($vo.loops_time) and $vo.loops_time > 0}
                    <span class="layui-badge layui-bg-orange margin-right-5">循</span>
                    {/if}

                    {if $vo.rscript eq 1}
                    <span class="layui-badge layui-bg-green margin-right-5">复</span>
                    {else}
                    <span class="layui-badge layui-bg-blue margin-right-5">单</span>
                    {/if}

                    {eq name='vo.status' value='1'}
                    <span class="layui-badge layui-bg-black">待处理</span>
                    {elseif $vo.status eq 2}
                    <span class="layui-badge layui-bg-green">处理中</span>
                    {elseif $vo.status eq 3}
                    <span class="layui-badge layui-bg-blue">处理完成</span>
                    {elseif $vo.status eq 4}
                    <span class="layui-badge layui-bg-red margin-right-5">处理失败</span>
                    <a class="layui-badge layui-bg-green" data-confirm="确定要重置该任务吗？" data-tips-text="重置该任务"
                       data-queue="{:url('redo')}?code={$vo.code}"><i class="layui-icon font-s12">&#xe669;</i></a>
                    {/eq}
                    <a data-action='{:url("remove")}' data-confirm="确定要删除该任务吗？" data-value="id#{$vo.id}"
                       data-tips-text="删除该任务" class='layui-badge layui-bg-red margin-left-5'><i class="layui-icon">&#xe640;</i></a>

                    <a onclick="$.loadQueue('{$vo.code}',false)" data-tips-text="任务进度信息"
                       class='layui-badge layui-bg-orange margin-left-5'><i class="layui-icon">&#xe705;</i></a>
                </div>
                <div class="color-desc">{$vo.exec_desc|default="没有获取到状态描述"}</div>
            </td>
        </tr>
        {/foreach}
        </tbody>
    </table>

    {empty name='list'}<span class="notdata" style="margin-bottom: 300px">没有记录哦</span>{else}{$pagehtml|default=''}{/empty}

</div>


{include file="public/footer" /}
<script>

    layui.use([], function () {
        $.loadQueue = function (code, doScript, doAjax) {
            layer.open({
                type: 1, title: false, area: ['560px', '315px'], anim: 2, shadeClose: false, end: function () {
                    doAjax = false;
                }, content: '' +
                    '<div class="padding-30 padding-bottom-0" style="width:500px" data-queue-load="' + code + '">' +
                    '   <div class="layui-elip nowrap" data-message-title></div>' +
                    '   <div class="margin-top-15 layui-progress layui-progress-big" lay-showPercent="yes"><div class="layui-progress-bar transition" lay-percent="0.00%"></div></div>' +
                    '   <div class="margin-top-15"><textarea class="layui-textarea layui-bg-black border-0" disabled style="resize:none;overflow:hidden;height:190px"></textarea></div>' +
                    '</div>'
            });
            (function loadprocess(code, that) {
                that = this, this.$box = $('[data-queue-load=' + code + ']');
                if (doAjax === false || that.$box.length < 1) return false;
                this.$area = that.$box.find('textarea'), this.$title = that.$box.find('[data-message-title]');
                this.$percent = that.$box.find('.layui-progress div'), this.runCache = function (code, index, value) {
                    this.ckey = code + '_' + index, this.ctype = 'admin-queue-script';
                    return value !== undefined ? layui.data(this.ctype, {
                        key: this.ckey,
                        value: value
                    }) : layui.data(this.ctype)[this.ckey] || 0;
                };
                this.setState = function (status, message) {
                    if (message.indexOf('javascript:') === -1) if (status === 1) {
                        that.$title.html('<b class="color-text">' + message + '</b>').addClass('text-center');
                        that.$percent.addClass('layui-bg-blue').removeClass('layui-bg-green layui-bg-red');
                    } else if (status === 2) {
                        if (message.indexOf('>>>') > -1) {
                            that.$title.html('<b class="color-blue">' + message + '</b>').addClass('text-center');
                        } else {
                            that.$title.html('<b class="color-blue">正在处理：</b>' + message).removeClass('text-center');
                        }
                        that.$percent.addClass('layui-bg-blue').removeClass('layui-bg-green layui-bg-red');
                    } else if (status === 3) {
                        that.$title.html('<b class="color-green">' + message + '</b>').addClass('text-center');
                        that.$percent.addClass('layui-bg-green').removeClass('layui-bg-blue layui-bg-red');
                    } else if (status === 4) {
                        that.$title.html('<b class="color-red">' + message + '</b>').addClass('text-center');
                        that.$percent.addClass('layui-bg-red').removeClass('layui-bg-blue layui-bg-green');
                    }
                };
                $.post('{:url("progress")}', {code: code}, function (ret) {
                    if (ret.code) {
                        that.lines = [];
                        for (this.lineIndex in ret.data.history) {
                            this.line = ret.data.history[this.lineIndex], this.percent = '[ ' + this.line.progress + '% ] ';
                            if (this.line.message.indexOf('javascript:') === -1) {
                                that.lines.push(this.line.message.indexOf('>>>') > -1 ? this.line.message : this.percent + this.line.message);
                            } else if (!that.runCache(code, this.lineIndex) && doScript !== false) {
                                that.runCache(code, this.lineIndex, 1), location.href = this.line.message;
                            }
                        }
                        that.$area.val(that.lines.join("\n")), that.$area.animate({scrollTop: that.$area[0].scrollHeight + 'px'}, 200);
                        that.$percent.attr('lay-percent', (parseFloat(ret.data.progress || '0.00').toFixed(2)) + '%'), layui.element.render();
                        if (ret.data.status > 0) that.setState(parseInt(ret.data.status), ret.data.message);
                        else return that.setState(4, '获取任务详情失败！'), false;
                        if (parseInt(ret.data.status) === 3 || parseInt(ret.data.status) === 4) return false;
                        return setTimeout(function () {
                            loadprocess(code);
                        }, 500), false;
                    }
                }, false);
            })(code)
        };

    })

    $(function () {
        window.$body = $('body');
        /*! 消息组件实例 */
        $.msg = new function (that) {
            that = this;
            this.idx = [];
            this.shade = [0.02, '#000'];
            // 关闭消息框
            this.close = function (index) {
                return layer.close(index);
            };
            // 弹出警告框
            this.alert = function (msg, callback) {
                var index = layer.alert(msg, {end: callback, scrollbar: false});
                return this.idx.push(index), index;
            };
            // 确认对话框
            this.confirm = function (msg, ok, no) {
                var index = layer.confirm(msg, {title: '操作确认', btn: ['确认', '取消']}, function () {
                    typeof ok === 'function' && ok.call(this, index);
                }, function () {
                    typeof no === 'function' && no.call(this, index);
                    that.close(index);
                });
                return index;
            };
            // 显示成功类型的消息
            this.success = function (msg, time, callback) {
                var index = layer.msg(msg, {
                    icon: 1,
                    shade: this.shade,
                    scrollbar: false,
                    end: callback,
                    time: (time || 2) * 1000,
                    shadeClose: true
                });
                return this.idx.push(index), index;
            };
            // 显示失败类型的消息
            this.error = function (msg, time, callback) {
                var index = layer.msg(msg, {
                    icon: 2,
                    shade: this.shade,
                    scrollbar: false,
                    time: (time || 3) * 1000,
                    end: callback,
                    shadeClose: true
                });
                return this.idx.push(index), index;
            };
            // 状态消息提示
            this.tips = function (msg, time, callback) {
                var index = layer.msg(msg, {time: (time || 3) * 1000, shade: this.shade, end: callback, shadeClose: true});
                return this.idx.push(index), index;
            };
            // 显示正在加载中的提示
            this.loading = function (msg, callback) {
                var index = msg ? layer.msg(msg, {
                    icon: 16,
                    scrollbar: false,
                    shade: this.shade,
                    time: 0,
                    end: callback
                }) : layer.load(2, {time: 0, scrollbar: false, shade: this.shade, end: callback});
                return this.idx.push(index), index;
            };
            // 自动处理显示Think返回的Json数据
            this.auto = function (ret, time) {
                var url = ret.url || (typeof ret.data === 'string' ? ret.data : '');
                var msg = ret.msg || (typeof ret.info === 'string' ? ret.info : '');
                if (parseInt(ret.code) === 1 && time === 'false') {
                    return url ? (window.location.href = url) : $.form.reload();
                }
                return (parseInt(ret.code) === 1) ? this.success(msg, time, function () {
                    url ? (window.location.href = url) : $.form.reload();
                    for (var i in that.idx) layer.close(that.idx[i]);
                    that.idx = [];
                }) : this.error(msg, 3, function () {
                    url ? window.location.href = url : '';
                });
            };
        };



        /*! 表单自动化组件 */
        $.form = new function (that) {
            that = this;
            // 内容区选择器
            this.selecter = '.layui-layout-admin>.layui-body';
            // 刷新当前页面
            this.reload = function () {
                window.onhashchange.call(this);
            };
            // 内容区域动态加载后初始化
            this.reInit = function ($dom) {
                $.vali.listen(this);
                $dom = $dom || $(this.selecter);
                $dom.find('[required]').map(function ($parent) {
                    if (($parent = $(this).parent()) && $parent.is('label')) {
                        $parent.addClass('label-required-prev');
                    } else {
                        $parent.prevAll('label').addClass('label-required-next');
                    }
                });
                $dom.find('input[data-date-range]').map(function () {
                    this.setAttribute('autocomplete', 'off');
                    laydate.render({
                        type: this.getAttribute('data-date-range') || 'date',
                        range: true, elem: this, done: function (value) {
                            $(this.elem).val(value).trigger('change');
                        }
                    });
                });


                $dom.find('input[data-date]').map(function () {
                    this.setAttribute('autocomplete', 'off');

                    var config = {
                        type: this.getAttribute('data-date') || 'date',
                        range: false, elem: this, done: function (value) {
                            $(this.elem).val(value).trigger('change');
                        }
                    }

                    if (this.getAttribute('data-format')) {
                        config.format = this.getAttribute('data-format')
                    }

                    laydate.render(config);
                });

                $dom.find('input[data-date-input]').map(function () {
                    this.setAttribute('autocomplete', 'off');
                    laydate.render({
                        type: this.getAttribute('data-date-input') || 'date',
                        range: false, elem: this, done: function (value) {
                            $(this.elem).val(value).trigger('change');
                        }
                    });
                });
                $dom.find('[data-file]:not([data-inited])').map(function (index, elem, $this, field) {
                    $this = $(elem), field = $this.attr('data-field') || 'file';
                    if (!$this.data('input')) $this.data('input', $('[name="' + field + '"]').get(0));
                    $this.uploadFile(function (url, file) {
                        $($this.data('input')).data('file', file).val(url).trigger('change');
                    });
                });
            };
            // 在内容区显示视图
            this.show = function (html) {
                $(this.selecter).html(html);
                this.reInit($(this.selecter));
                setTimeout(function () {
                    that.reInit($(that.selecter));
                }, 500);
            };

            // 异步加载的数据
            this.load = function (url, data, method, callback, loading, tips, time, headers) {
                var index = loading !== false ? $.msg.loading(tips) : 0;
                if (typeof data === 'object' && typeof data['_token_'] === 'string') {
                    headers = headers || {}, headers['User-Form-Token'] = data['_token_'], delete data['_token_'];
                }
                $.ajax({
                    data: data || {}, type: method || 'GET', url: url, beforeSend: function (xhr, i) {
                        if (typeof Pace === 'object' && loading !== false) Pace.restart();
                        if (typeof headers === 'object') for (i in headers) xhr.setRequestHeader(i, headers[i]);
                    }, error: function (XMLHttpRequest, $dialog, dialogIdx, iframe) {
                        if (parseInt(XMLHttpRequest.status) !== 200 && XMLHttpRequest.responseText.indexOf('Call Stack') > -1) try {
                            dialogIdx = layer.open({
                                title: XMLHttpRequest.status + ' - ' + XMLHttpRequest.statusText,
                                type: 2,
                                move: false,
                                content: 'javascript:;'
                            });
                            layer.full(dialogIdx), $dialog = $('#layui-layer' + dialogIdx), iframe = $dialog.find('iframe').get(0);
                            (iframe.contentDocument || iframe.contentWindow.document).write(XMLHttpRequest.responseText);
                            $dialog.find('.layui-layer-setwin').css({
                                right: '35px',
                                top: '28px'
                            }).find('a').css({marginLeft: 0});
                            $dialog.find('.layui-layer-title').css({
                                color: 'red',
                                height: '70px',
                                lineHeight: '70px',
                                fontSize: '22px',
                                textAlign: 'center',
                                fontWeight: 700
                            });
                        } catch (e) {
                            layer.close(dialogIdx);
                        }
                        layer.closeAll('loading');
                        if (parseInt(XMLHttpRequest.status) !== 200) {
                            $.msg.tips('E' + XMLHttpRequest.status + ' - 服务器繁忙，请稍候再试！');
                        } else {
                            this.success(XMLHttpRequest.responseText);
                        }
                    }, success: function (ret) {
                        if (typeof callback === 'function' && callback.call(that, ret) === false) return false;
                        return typeof ret === 'object' ? $.msg.auto(ret, time || ret.wait || undefined) : that.show(ret);
                    }, complete: function () {
                        $.msg.close(index);
                    }
                });
            };
            // 加载HTML到目标位置
            this.open = function (url, data, callback, loading, tips) {
                this.load(url, data, 'get', function (ret) {
                    return (typeof ret === 'object' ? $.msg.auto(ret) : that.show(ret)), false;
                }, loading, tips);
            };
            // 打开一个iframe窗口
            this.iframe = function (url, title, area) {
                return layer.open({
                    title: title || '窗口',
                    type: 2,
                    area: area || ['800px', '580px'],
                    fix: true,
                    maxmin: false,
                    content: url
                });
            };
            // 加载HTML到弹出层
            this.modal = function (url, data, title, callback, loading, tips, width) {
                this.load(url, data, 'GET', function (res, index) {
                    if (typeof (res) === 'object') return $.msg.auto(res), false;
                    index = layer.open({
                        type: 1,
                        btn: false,
                        area: width || "800px",
                        content: res,
                        title: title || '',
                        success: function (dom, index) {
                            $(dom).find('[data-close]').off('click').on('click', function () {
                                if ($(this).attr('data-confirm')) return $.msg.confirm($(this).attr('data-confirm'), function (_index) {
                                    layer.close(_index), layer.close(index);
                                }), false;
                                layer.close(index);
                            });
                            $.form.reInit($(dom));
                        }
                    });
                    $.msg.idx.push(index);
                    return (typeof callback === 'function') && callback.call(that);
                }, loading, tips);
            };
        };


        /*! 异步任务状态监听与展示 */
        $body.on('click', '[data-queue]', function (action) {
            action = this.getAttribute('data-queue') || '';
            if (action.length < 1) return $.msg.tips('任务地址不能为空！');
            this.doRuntime = function (index) {
                $.form.load(action, {}, 'post', function (ret) {
                    if (typeof ret.data === 'string' && ret.data.indexOf('Q') === 0) {
                        return $.loadQueue(ret.data, true), false;
                    }
                }), $.msg.close(index);
            };
            $(this).attr('data-confirm') ? $.msg.confirm($(this).attr('data-confirm'), this.doRuntime) : this.doRuntime(0);
        });

        /*! 注册 data-action 事件行为 */
        $body.on('click', '[data-action]', function () {
            var $this = $(this), data = {}, time = $this.attr('data-time'), action = $this.attr('data-action');
            var loading = $this.attr('data-loading'), method = $this.attr('data-method') || 'post';
            var rule = $this.attr('data-value') || (function (rule, ids) {
                $($this.attr('data-target') || 'input[type=checkbox].list-check-box').map(function () {
                    (this.checked) && ids.push(this.value);
                });
                return ids.length > 0 ? rule.replace('{key}', ids.join(',')) : '';
            }).call(this, $this.attr('data-rule') || '', []) || '';
            if (rule.length < 1) return $.msg.tips('请选择需要更改的数据！');
            var rules = rule.split(';');
            for (var i in rules) {
                if (rules[i].length < 2) return $.msg.tips('异常的数据操作规则，请修改规则！');
                data[rules[i].split('#')[0]] = rules[i].split('#')[1];
            }
            data['_token_'] = $this.attr('data-token') || $this.attr('data-csrf') || '--';
            var load = loading !== 'false', tips = typeof loading === 'string' ? loading : undefined;
            if (!$this.attr('data-confirm')) $.form.load(action, data, method, false, load, tips, time);
            else $.msg.confirm($this.attr('data-confirm'), function () {
                $.form.load(action, data, method, false, load, tips, time);
            });
        });
    })
</script>
</body>
</html>